home *** CD-ROM | disk | FTP | other *** search
- PXFDIRECTORY(3F) Last changed: 1-22-99
-
-
- NNAAMMEE
- PPXXFFOOPPEENNDDIIRR, PPXXFFRREEAADDDDIIRR, PPXXFFRREEWWIINNDDDDIIRR, PPXXFFCCLLOOSSEEDDIIRR, - Performs
- directory operations
-
- SSYYNNOOPPSSIISS
- SSUUBBRROOUUTTIINNEE PPXXFFOOPPEENNDDIIRR ((_d_i_r_n_a_m_e,, _l_e_n_d_i_r_n_a_m_e,, _i_o_p_e_n_d_i_r_i_d,, _i_e_r_r_o_r))
- CCHHAARRAACCTTEERR*_n _d_i_r_n_a_m_e
- IINNTTEEGGEERR _l_e_n_d_i_r_n_a_m_e,, _i_o_p_e_n_d_i_r,, _i_e_r_r_o_r
-
- SSUUBBRROOUUTTIINNEE PPXXFFRREEAADDDDIIRR ((_i_d_i_r_i_d,, _j_d_i_r_e_n_t,, _i_e_r_r_o_r))
- IINNTTEEGGEERR _i_d_i_r_i_d,, _j_d_i_r_e_n_t,, _i_e_r_r_o_r
-
- SSUUBBRROOUUTTIINNEE PPXXFFRREEWWIINNDDDDIIRR ((_i_d_i_r_i_d,, _i_e_r_r_o_r))
- IINNTTEEGGEERR _i_d_i_r_i_d,, _i_e_r_r_o_r
-
- SSUUBBRROOUUTTIINNEE PPXXFFCCLLOOSSEEDDIIRR ((_i_d_i_r_i_d,, _i_e_r_r_o_r))
- IINNTTEEGGEERR _i_d_i_r_i_d,, _i_e_r_r_o_r
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- IEEE standard interface for FORTRAN 77
-
- DDEESSCCRRIIPPTTIIOONN
- On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
- default when compiling programs with the MIPSpro 7 Fortran 90 compiler
- or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
- F77 compiler.
-
- The PPXXFFOOPPEENNDDIIRR subroutine uses the ooppeennddiirr(3C) routine to open a
- directory stream for the directory _d_i_r_n_a_m_e and positions the stream at
- the first directory entry.
-
- The PPXXFFRREEAADDDDIIRR subroutine uses the rreeaaddddiirr(3C) function to read a
- directory stream for the next entry in the directory stream.
-
- The PPXXFFRREEWWIINNDDDDIIRR subroutine uses the rreewwiinnddddiirr(3C) function to reset
- the position in the directory stream to the first entry of a directory
- stream while updating the directory stream to the current state of the
- directory, as a call to PPXXFFOOPPEENNDDIIRR would do.
-
- The PPXXFFCCLLOOSSEEDDIIRR subroutine uses the cclloosseeddiirr(3C) function to close the
- directory stream referenced by _i_d_i_r_i_d. Upon sucessful completion,
- _i_d_i_r_i_d is undefined and the result of subsequent calls to PPXXFFCCLLOOSSEEDDIIRR
- with _i_d_i_r_i_d is not well defined.
-
- When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
- UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
- kind unless documented otherwise. On UNICOS and UNICOS/mk, default
- kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
- IRIX, the default kind is KKIINNDD==44.
-
- The following is a list of valid arguments for these subroutines:
-
- _d_i_r_n_a_m_e An input character array variable containing the path for
- the directory to be opened.
-
- _l_e_n_d_i_r_n_a_m_e
- An input integer variable containing the length of _d_i_r_n_a_m_e.
-
- _i_o_p_e_n_d_i_r_i_d
- An output integer variable for the unique directory ID.
-
- _i_e_r_r_o_r An output integer variable that contains zero if the
- operation was successful or nonzero if the operation was not
- successful.
-
- The _i_o_p_e_n_d_i_r_i_d argument becomes the unique directory ID (_i_d_i_r_i_d) that
- is used by PPXXFFRREEAADDDDIIRR, PPXXFFRREEWWIINNDDDDIIRR, and PPXXFFCCLLOOSSEEDDIIRR.
-
- _i_d_i_r_i_d
- An input integer variable for the unique directory ID generated
- by PPXXFFOOPPEENNDDIIRR.
-
- _j_d_i_r_e_n_t
- An output structure handle created by PPXXFFSSTTRRUUCCTTCCRREEAATTEE(3F) that
- contains one directory entry.
-
- * The PPXXFFOOPPEENNDDIIRR subroutine may return any of the following error
- values:
-
- EEAACCCCEESS If a component of _d_i_r_n_a_m_e denies search permission.
-
- EENNAAMMEETTOOOOLLOONNGG
- If the length of the _d_i_r_n_a_m_e argument exceeds PPAATTHH__MMAAXX found
- in <<lliimmiittss..hh>> (IRIX systems only).
-
- EENNOOEENNTT If the directory in the _d_i_r_n_a_m_e argument does not exist.
-
- EENNOOTTDDIIRR If a component of _d_i_r_n_a_m_e is not a directory.
-
- EEIINNVVAALL If _l_e_n_d_i_r_n_a_m_e < 0 or _l_e_n_d_i_r_n_a_m_e > LLEENN((_d_i_r_n_a_m_e)).
-
- EENNOOMMEEMM If memory needed by PPXXFFOOPPEENNDDIIRR could not be allocated.
-
- EEMMFFIILLEE If too many file descriptors are currently open for the
- process.
-
- EENNFFIILLEE If too many file descriptors are currently open for the
- system (IRIX systems only).
-
- * The PPXXFFRREEAADDDDIIRR subroutine may return any of the following error
- values:
-
- EEBBAADDFF If, when detected, an invalid, unique directory stream ID
- was used for _i_d_i_r_i_d.
-
- EEEENNDD If the end of the directory stream has been reached.
-
- EENNOOMMEEMM If data structures need for successful completion of
- PPXXFFRREEAADDIIRR cannot be allocated.
-
- EENNOOEENNTT If the current file pointer for the directory stream is not
- located at a valid directory entry.
-
- EEDDIIRRCCOORRRRUUPPTTEEDD
- If the directory on disk is corrupt (IRIX systems only).
-
- EEBBAADDIIDD If _i_d_i_r_i_d is an invalid directory identifier (UNICOS and
- UNICOS/mk systems only).
-
- EEBBAADDHHAANNDDLLEE
- If _j_d_i_r_e_n_t is an invalid handle or has an incorrect handle
- type (UNICOS and UNICOS/mk systems only).
-
- * The PPXXFFCCLLOOSSEEDDIIRR subroutine may return the following error value:
-
- EEBBAADDFF If, when detected, an invalid, unique directory stream ID
- was used for _i_d_i_r_i_d.
-
- EEXXAAMMPPLLEESS
- In this example, the //ddeevv//ddsskk directory is opened, the directory
- entries are read and printed, the directory is rewound and the
- contents are redisplayed, and then the directory is closed.
-
- program pxftest
- integer ierror
- integer (KIND=8) jdirent,idirid
-
- CALL PXFSTRUCTCREATE('dirent',jdirent,ierror)
- CALL PXFOPENDIR('/dev/dsk',0,idirid,ierror)
- call printdir(idirid,jdirent)
- CALL PXFREWINDDIR(idirid,ierror)
- call printdir(idirid,jdirent)
- CALL PXFCLOSEDIR(idirid,ierror)
- end
-
- subroutine printdir(idirid,jdirent)
- integer ierror, ilen, EEND
- integer (KIND=8) jdirent, idirid
- character*30 name
-
- CALL PXFCONST('EEND',EEND,ierror)
- do while ((ierror .ne. EEND) .and. (ierror .eq. 0))
- CALL PXFREADDIR(idirid,jdirent,ierror)
- CALL PXFSTRGET(jdirent,'d_name',name,ilen,ierror)
- if (ierror .eq. 0) print *,name
- enddo
- end
-
- SSEEEE AALLSSOO
- ddiirreeccttoorryy(3C)
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
- version of this man page.
-